#ifndef __PLATEAU_HH__
#define __PLATEAU_HH__

#include "grille.hh"
#include "coup.hh"
#include <iostream>

using namespace std;

#define P1	true
#define P2	false

#define P1_ID	1
#define P2_ID	2

#define PLATEAU_GRILLE_WIDTH	8
#define PLATEAU_GRILLE_HEIGHT	8
#define PLATEAU_CASE_VIDE		0
#define PLATEAU_TROU		4

class Plateau {
	friend ostream &operator << (ostream &os, const Plateau &pl);
	
	public :
		Plateau ();
		
		void placer (const Point&, const Player&);
		void jouer (const Coup&);
		
		bool valide (const Coup&) const;
		bool getPlayer () const { return this->player; };
		
	private :
		Grille<int> grille;
		Grille<int*> territory;
		Player player;
		int numb[2];
		int eval[2];
	
		void deplacer (const Point&, const Point&);
		void contaminer (const Point&, const Player&);
		void occuperTerritoire (const Point&, const Player&);
		int valPlayer (const Player &p) { return (p ? P1_ID : P2_ID); }
		void swap ();
		void setNumbPlayer (const Player&, int);
		void setEvalPlayer (const Player&, int);
};

#endif
